package com.iatinspur.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class TestController {


    @Autowired
    RestTemplate restTemplate;

    @Autowired
    DiscoveryClient client;

    @GetMapping("/getResult")
    public String getResult(){
        return restTemplate.getForObject("http://simple-service/getResult",String.class);
    }


    @GetMapping("/getGateResult")
    public String getGateWayResult(){
        return restTemplate.getForObject("http://gate-way/simple-service/getResult",String.class);
    }
}
